﻿@model ProductDetailsModel.ProductVariantModel.AddToCartModel
@using Nop.Web.Framework;
@using Nop.Web.Models.Catalog;
<div class="add-info">
    @if (Model.CustomerEntersPrice)
    {
        <div>
            @Html.LabelFor(model => model.CustomerEnteredPrice, new { @class = "enter-price-label" })
            @*round price*@
            @Html.TextBox("CustomerEnteredPrice", Convert.ToInt32(Math.Ceiling(Model.CustomerEnteredPrice)), new { @class = "enter-price-input" })
        </div>
        <div>
            @Model.CustomerEnteredPriceRange
        </div>
    }
    @if (!Model.DisableBuyButton || !Model.DisableWishlistButton)
    {
        <div>
            @if (Model.AllowedQuantities.Count > 0)
            {
                <div data-role="fieldcontain">
                    <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
                        @Html.LabelFor(model => model.EnteredQuantity, new { @class = "qty-label" })
                        @Html.DropDownListFor(model => model.EnteredQuantity, Model.AllowedQuantities, new { @class = "qty-dropdown" })
                    </fieldset>
                </div>
            }
            else
            {
                @Html.LabelFor(model => model.EnteredQuantity, new { @class = "qty-label" })
                @Html.TextBoxFor(model => model.EnteredQuantity, new { @class = "qty-input" })
            }
        </div>
    }
    @if (!Model.DisableBuyButton)
    {
        <input type="submit" name="addtocartbutton-@(Model.ProductVariantId)" value="@(Model.AvailableForPreOrder ? T("ShoppingCart.PreOrder") : T("ShoppingCart.AddToCart"))" />
    }
    @if (!Model.DisableWishlistButton)
    {
        <input type="submit" name="addtowishlistbutton-@(Model.ProductVariantId)" value="@T("ShoppingCart.AddToWishlist")" />
    }
    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "mobile_productdetails_add_info" })
</div>
